package com.itheima.tlias84.controller;

import com.itheima.tlias84.dto.ReportEmpGenderDTO;
import com.itheima.tlias84.dto.ReportStudentDTO;
import com.itheima.tlias84.service.EmpService;
import com.itheima.tlias84.service.StudentService;
import com.itheima.tlias84.utils.ResultUtil;
import jakarta.annotation.Resource;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;

@RestController
@RequestMapping("/report")
public class ReportController {
    @Resource
    EmpService empService;
    @Resource
    StudentService studentService;

    @GetMapping("/empGenderData")
    public ResultUtil countEmpGender() {
        List<ReportEmpGenderDTO> list = empService.countEmpGender();
//        SelectGenderCountDTO dto2 = empService.countEmpGender(2);
//        List<SelectGenderCountDTO> list = new ArrayList<>();
//        list.add(dto);
//        list.add(dto2);
        return ResultUtil.success(list);
    }

    @GetMapping("/empJobData")
    public ResultUtil countEmpJob() {
        return empService.countEmpJob();
    }

    @GetMapping("/studentDegreeData")
    public ResultUtil countStudentDegree() {
        List<ReportStudentDTO> list = studentService.countStudentDegree();
        return ResultUtil.success(list);
    }

    @GetMapping("/studentCountData")
    public ResultUtil countStudentClazz() {
        ResultUtil resultUtil = studentService.countStudentClazz();
        return resultUtil;
    }
}
